using IcsSEMCtrl.Util;
using System;
namespace IcsSEMCtrl.Global.Device
{
	public class LocationType
	{
		public const int _CarrierLocation = 0;
		public const int _SubstrateLocation = 1;
		private int _value;
		private static int _size;
		private static LocationType[] _array;
		public static string[] displayStrings;
		public static LocationType[] displayValues;
		public static LocationType CarrierLocation;
		public static LocationType SubstrateLocation;
		public static LocationType IT_ENUM_MAX;
		static LocationType()
		{
			LocationType._size = 2;
			LocationType._array = new LocationType[LocationType._size];
			LocationType.displayStrings = new string[LocationType._size];
			LocationType.displayValues = new LocationType[LocationType._size];
			LocationType.CarrierLocation = new LocationType(0);
			LocationType.SubstrateLocation = new LocationType(1);
			LocationType.IT_ENUM_MAX = new LocationType(2147483647);
			LocationType.displayStrings[0] = "CarrierLocation";
			LocationType.displayStrings[1] = "SubstrateLocation";
			LocationType.displayValues[0] = LocationType.CarrierLocation;
			LocationType.displayValues[1] = LocationType.SubstrateLocation;
		}
		public static string ValueToString(LocationType val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = LocationType.displayStrings[0];
				break;
			case 1:
				result = LocationType.displayStrings[1];
				break;
			default:
				result = "";
				break;
			}
			return result;
		}
		public static LocationType StringToValue(string val)
		{
			LocationType result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = LocationType.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < LocationType.displayStrings.Length; i++)
				{
					if (val.Equals(LocationType.displayStrings[i]))
					{
						result = LocationType.displayValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static LocationType From_Int(int value)
		{
			LocationType result;
			if (value >= 0 && value < LocationType._size)
			{
				result = LocationType._array[value];
			}
			else
			{
				result = LocationType.IT_ENUM_MAX;
			}
			return result;
		}
		protected LocationType(int value)
		{
			this._value = value;
			if (value >= 0 && value < LocationType._size)
			{
				LocationType._array[this._value] = this;
			}
		}
		public bool Equals(LocationType otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return LocationType.displayStrings[this._value];
		}
	}
}
